package design.observe;

import java.util.ArrayList;
import java.util.List;

public class Teacher implements Subject{
    private List<Observer> observers=new ArrayList<>();

    @Override
    public boolean registerOberser(Observer observer) {
        return observers.add(observer);
    }

    @Override
    public boolean removeObserver(Observer observer) {
        return false;
    }

    @Override
    public boolean notifyObservers() {
        for(Observer observer:observers){
            observer.update("明天开始补课。。。。");
        }
        return false;
    }
}
